package cn.leaf.impl;

import cn.leaf.api.HelloDubboService;
import cn.leaf.entity.StarEntity;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Value;

/**
 *
 * description: dubbo interface implements
 *
 * @author Cyril
 * @version v1.0.0
 * @since 2021-05-25 09:42:12
 *
 */
@DubboService(version = "1.0.0", filter = "DubboFilter")
public class HelloDubboServiceImpl implements HelloDubboService {

    @Value("${spring.application.name}")
    private String applicationName;

    @Override
    public String helloDubbo() {
        return String.format("hello, dubbo i am %s", applicationName);
    }

    @Override
    public StarEntity starInfo() {
        return StarEntity.builder()
                .id(1)
                .name("欧阳娜娜")
                .age(20)
                .sex("女")
                .build();
    }
}
